package com.liuzhilong.infrastructure.basic.proxy.fixed;

import com.liuzhilong.infrastructure.basic.proxy.RealSubject;
import com.liuzhilong.infrastructure.basic.proxy.Subject;

public class Proxy implements Subject {
    private Subject subject=new RealSubject();

    @Override
    public void do1() {
        System.out.println("我是前置代理逻辑，我在被代理对象执行之前执行");
        subject.do1();
        System.out.println("我是后置代理对象，我在被代理对象执行之后执行");
    }

    @Override
    public String do2() {
        return subject.do2();
    }

    @Override
    public String do3(String params) {
        return  subject.do3(params);
    }
}
